<template>
  <view class="page">
    <Header
      :titleFlag="false"
      :userInfoFlag="false"
      :selectTextbookFlag="true"
      @select="handleSelectBook"
    ></Header>
    <view class="main_container">
      <view class="main_content">
        <view class="content">
          <view class="top">
            <view class="title">{{ bookInfo.bookEdition }}</view>
            <view class="subtitle">
              <view></view>
              <text>{{ bookInfo.bookEdition }}{{ bookInfo.bookYear }}</text>
              <view></view>
            </view>
          </view>
          <view class="bottom">
            <view
              class="box_nav box_nav_bg1"
              @click="
                switchPage(`/pages/word/wordSelect?bookId=${bookInfo.bookId}`)
              "
            >
              <text>单词本</text>
              <view class="box_icon box_icon1">
                <image
                  src="https://hengxiao-resource.oss-cn-hangzhou.aliyuncs.com/web/resources/images/hengxiao/word/arrow.png"
                  mode="scaleToFill"
                />
              </view>
            </view>

            <view class="box_img">
              <view class="box_bg">
                <image src="https://hengxiao-resource.oss-cn-hangzhou.aliyuncs.com/web/resources/images/hengxiao/word/bg.png" mode="scaleToFill" />
              </view>
            </view>

            <view
              class="box_nav box_nav_bg2"
              @click="switchPage('/pages/review/review1')"
            >
              <text>抗遗忘</text>
              <view class="box_icon box_icon2" style="transform: scaleX(-1)">
                <image
                  src="https://hengxiao-resource.oss-cn-hangzhou.aliyuncs.com/web/resources/images/hengxiao/word/arrow.png"
                  mode="scaleToFill"
                />
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { getDefaultBook } from "@/api/sync";
export default {
  components: {},
  data() {
    return {
      bookInfo: {},
    };
  },
  onShow() {
    this.getData();
  },
  onLoad() {},
  methods: {
    getData() {
      getDefaultBook().then((res) => {
        this.bookInfo = res.data;
      });
    },
    handleSelectBook() {
      uni.navigateTo({
        url: "/pages/word/wordCourse",
      });
    },
    switchPage(url) {
      uni.navigateTo({
        url: url,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
@import "./word";
</style>
